package com.example.projectdemo.Activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;

import com.example.projectdemo.R;
import com.example.projectdemo.config.DBOpenHelper;
import com.example.projectdemo.domain.Place;

public class InformActivity extends AppCompatActivity implements View.OnClickListener {
    DBOpenHelper dbOpenHelper;
    private String user,pass;
    private int id;
    private String type;
    private EditText et_name;
    private EditText et_place;
    private EditText et_phone;
    private EditText et_introduce;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_inform);

        et_name = findViewById(R.id.et_name);
        et_place = findViewById(R.id.et_place);
        et_phone = findViewById(R.id.et_phone);
        et_introduce = findViewById(R.id.et_introduce);
        findViewById(R.id.saves).setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        String name = et_name.getText().toString().trim();
        String place = et_place.getText().toString().trim();
        String phone = et_phone.getText().toString().trim();
        String introduce = et_introduce.getText().toString().trim();
        dbOpenHelper.add5(name,place,introduce,phone);
        Intent intent = new Intent(this,OrdersActivity.class);
        startActivity(intent);
        finish();

    }
}